package com.ds.components.builders;

import com.ds.components.grid.DisplayGrid;
import com.ds.renderer.GenericRenderer;
import com.ds.renderer.HeaderRenderer;

import java.awt.*;

public class DisplayGridBuilder extends ComponentBuilder<DisplayGrid> 
{
	private int cellHeight = 22;
	private int cellWidth  = 40;
	private int columnsNo  = 1;
	private int rowsNo     = 1;
	private int hGap = 0;
	private int vGap = 0;
	private int leftHeaderWidth = 0;
	private int topHeaderHeight = 0;
	private boolean drawGrid = false;
	private boolean drawGridBorder = false;
	private GenericRenderer glassPaneRenderer = null;
	private HeaderRenderer leftHeaderRenderer = null;
	private HeaderRenderer topHeaderRenderer = null;
	private Color gridColor = new Color( 128, 128, 128, 50 );
	
	/* (non-Javadoc)
	 * @see com.ds.components.builders.AbstractBuilder#build()
	 */
	@Override
	public DisplayGrid build() 
	{
		DisplayGrid grid = new DisplayGrid();
		
		grid.setCellHeight( this.cellHeight );
		grid.setCellWidth( this.cellWidth );
		grid.setLeftHeaderWidth( this.leftHeaderWidth );
		grid.setTopHeaderHeight( this.topHeaderHeight );
		grid.setColumnsNo( this.columnsNo );
		grid.setRowsNo( this.rowsNo );
		grid.setHGap( this.hGap );
		grid.setVGap( this.vGap );
		grid.setDrawGrid( this.drawGrid );
		grid.setDrawGridBorder( this.drawGridBorder );
		grid.setGlassPaneRenderer( this.glassPaneRenderer );
		grid.setLeftHeaderRenderer( this.leftHeaderRenderer );
		grid.setTopHeaderRenderer( this.topHeaderRenderer );
		grid.setGridColor( this.gridColor );
		grid.setBackground( Color.black );

		return grid;
	}

	/**
	 * @return the cellHeight
	 */
	public int getCellHeight() {
		return cellHeight;
	}

	/**
	 * @param cellHeight the cellHeight to set
	 */
	public void setCellHeight(int cellHeight) {
		this.cellHeight = cellHeight;
	}

	/**
	 * @return the cellWidth
	 */
	public int getCellWidth() {
		return cellWidth;
	}

	/**
	 * @param cellWidth the cellWidth to set
	 */
	public void setCellWidth(int cellWidth) {
		this.cellWidth = cellWidth;
	}

	/**
	 * @return the columnsNo
	 */
	public int getColumnsNo() {
		return columnsNo;
	}

	/**
	 * @param columnsNo the columnsNo to set
	 */
	public void setColumnsNo(int columnsNo) {
		this.columnsNo = columnsNo;
	}

	/**
	 * @return the drawGrid
	 */
	public boolean isDrawGrid() {
		return drawGrid;
	}

	/**
	 * @param drawGrid the drawGrid to set
	 */
	public void setDrawGrid(boolean drawGrid) {
		this.drawGrid = drawGrid;
	}

	/**
	 * @return the drawGridBorder
	 */
	public boolean isDrawGridBorder() {
		return drawGridBorder;
	}

	/**
	 * @param drawGridBorder the drawGridBorder to set
	 */
	public void setDrawGridBorder(boolean drawGridBorder) {
		this.drawGridBorder = drawGridBorder;
	}

	/**
	 * @return the glassPaneRenderer
	 */
	public GenericRenderer getGlassPaneRenderer() {
		return glassPaneRenderer;
	}

	/**
	 * @param glassPaneRenderer the glassPaneRenderer to set
	 */
	public void setGlassPaneRenderer(GenericRenderer glassPaneRenderer) {
		this.glassPaneRenderer = glassPaneRenderer;
	}

	/**
	 * @return the gridColor
	 */
	public Color getGridColor() {
		return gridColor;
	}

	/**
	 * @param gridColor the gridColor to set
	 */
	public void setGridColor(Color gridColor) {
		this.gridColor = gridColor;
	}

	/**
	 * @return the hGap
	 */
	public int getHGap() {
		return hGap;
	}

	/**
	 * @param gap the hGap to set
	 */
	public void setHGap(int gap) {
		hGap = gap;
	}

	/**
	 * @return the leftHeaderRenderer
	 */
	public HeaderRenderer getLeftHeaderRenderer() {
		return leftHeaderRenderer;
	}

	/**
	 * @param leftHeaderRenderer the leftHeaderRenderer to set
	 */
	public void setLeftHeaderRenderer(HeaderRenderer leftHeaderRenderer) {
		this.leftHeaderRenderer = leftHeaderRenderer;
	}

	/**
	 * @return the leftHeaderWidth
	 */
	public int getLeftHeaderWidth() {
		return leftHeaderWidth;
	}

	/**
	 * @param leftHeaderWidth the leftHeaderWidth to set
	 */
	public void setLeftHeaderWidth(int leftHeaderWidth) {
		this.leftHeaderWidth = leftHeaderWidth;
	}

	/**
	 * @return the rowsNo
	 */
	public int getRowsNo() {
		return rowsNo;
	}

	/**
	 * @param rowsNo the rowsNo to set
	 */
	public void setRowsNo(int rowsNo) {
		this.rowsNo = rowsNo;
	}

	/**
	 * @return the topHeaderHeight
	 */
	public int getTopHeaderHeight() {
		return topHeaderHeight;
	}

	/**
	 * @param topHeaderHeight the topHeaderHeight to set
	 */
	public void setTopHeaderHeight(int topHeaderHeight) {
		this.topHeaderHeight = topHeaderHeight;
	}

	/**
	 * @return the topHeaderRenderer
	 */
	public HeaderRenderer getTopHeaderRenderer() {
		return topHeaderRenderer;
	}

	/**
	 * @param topHeaderRenderer the topHeaderRenderer to set
	 */
	public void setTopHeaderRenderer(HeaderRenderer topHeaderRenderer) {
		this.topHeaderRenderer = topHeaderRenderer;
	}

	/**
	 * @return the vGap
	 */
	public int getVGap() {
		return vGap;
	}

	/**
	 * @param gap the vGap to set
	 */
	public void setVGap(int gap) {
		vGap = gap;
	}
}
